<!-- IF AJAX_TOPICS -->
<script type="text/javascript">
ajax.openedPosts = {};

ajax.view_post = function(post_id, src) {
	if (!ajax.openedPosts[post_id]) {
		ajax.exec({
			action  : 'view_post',
			post_id : post_id
		});
	}
	else {
		var $post = $('#post_'+post_id);
		if ($post.is(':visible')) {
			$post.hide();
		}	else {
			$post.css({ display: '' });
		}
	}
	$(src).toggleClass('unfolded2');
};

ajax.callback.view_post = function(data) {
	var post_id = data.post_id;
	var $tor = $('#tor_'+post_id);
	window.location.href='#tor_'+post_id;
	$('#post-row tr')
		.clone()
		.attr({ id: 'post_'+post_id })
		.find('div.post_body').html(data.post_html).end()
		.find('a.tLink').attr({ href: $('a.tLink', $tor).attr('href') }).end()
		.find('a.dLink').attr({ href: $('a.tr-dl', $tor).attr('href') }).end()
		.insertAfter($tor)
	;
	initPostBBCode('#post_'+post_id);
	var maxH   = screen.height - 290;
	var maxW   = screen.width - 60;
	var $post  = $('div.post_wrap', $('#post_'+post_id));
	var $links = $('div.post_links', $('#post_'+post_id));
	$post.css({ maxWidth: maxW, maxHeight: maxH });
	$links.css({ maxWidth: maxW });
	if ($.browser.msie) {
		if ($post.height() > maxH) { $post.height(maxH); }
		if ($post.width() > maxW)  { $post.width(maxW); $links.width(maxW); }
	}
	ajax.openedPosts[post_id] = true;
};
</script>

<style type="text/css">
.post_wrap { border: 1px #A5AFB4 solid; margin: 8px 8px 6px; overflow: auto; }
.post_links { margin: 6px; }
</style>

<table id="post-row" style="display: none;">
<tr>
	<td class="row2" colspan="{TOR_COLSPAN}">
		<div class="post_wrap row1">
			<div class="post_body pad_6"></div><!--/post_body-->
			<div class="clear"></div>
		</div><!--/post_wrap-->
		<div class="post_links med bold tCenter"><a class="tLink">{L_OPEN_TOPIC}</a> &nbsp;&#0183;&nbsp; <a class="dLink">{L_DL_TORRENT}</a></div>
	</td>
</tr>
</table>
<!-- ENDIF / AJAX_TOPICS -->

<a name="start"></a>
<h1 class="pagetitle">{PAGE_TITLE}</h1>

<div class="nav">
	<p class="floatL"><a href="{U_INDEX}">{T_INDEX}</a></p>
	<!-- IF MATCHES --><p class="floatR">{MATCHES} {SERACH_MAX}</p><!-- ENDIF -->
	<div class="clear"></div>
</div>

<!-- IF TORHELP_TOPICS -->
	<!-- INCLUDE torhelp.tpl -->
	<div class="spacer_6"></div>
<!-- ENDIF / TORHELP_TOPICS -->

<!-- IF SHOW_SEARCH_OPT -->
<script type="text/javascript">
var FSN = {
	fs_all      : '',
	fs_og       : [],
	fs_lb       : [],
	sel_width   : null,
	scroll      : $.browser.mozilla,
	nav_inited  : false,

	show_nav: function() {
		$('#fs>legend').empty().append( $('#fs-nav-legend').contents() );
	},
	build_nav: function() {

		if (FSN.nav_inited) return;

		var $fieldset = $('fieldset#fs');
		var $select = $('select:last', $fieldset);
		var $optgroup = $('optgroup', $select);

		$optgroup.each(function(i){
			var $og = $(this);
			$og.attr({ id: 'og-'+i });
			FSN.fs_og[i] = $(this).html();
			FSN.fs_lb[i] = $(this).attr('label');
			$('#fs-sel-cat').append('<option class="cat-title" value="'+ i +'">&nbsp;&nbsp;&middot;&nbsp;'+ FSN.fs_lb[i] +'&nbsp;</option>\n');
			$('<li><span class="b">'+ FSN.fs_lb[i] +'</span>\n<ul id="nav-c-'+ i +'"></ul>\n</li>').appendTo('#fs-nav-ul').click(function(){
				if (FSN.scroll) {
					$select.scrollTo('#og-'+i);
				}
			});
			$('option', $og).each(function(){
				var $op = $(this);
				if ($op[0].className) {
					$('<li><span class="f">'+ $op.html() +'</span>\n</li>').appendTo('#nav-c-'+ i).click(function(e){
						e.stopPropagation();
						if (FSN.scroll) {
							$select.scrollTo( '#'+$op.attr('id'), { duration:300 } ).scrollTo( '-=3px' );
						}
						$('option', $select).removeAttr('selected');
						$('#'+$op.attr('id')).attr({ selected: 1 });
						$('#fs-nav-list').fadeOut();
					});
				}
			});
		});

		$('#fs-nav-ul').treeview({ collapsed: true });
		// фикс для FF2, чтобы меню не выстраивалось лесенкой
		if ($.browser.mozilla && parseFloat($.browser.version) <= 1.8) {
			$('#fs-nav-list ul').after('<div style="margin-top: 1px;"></div>');
		}

		$('#fs-sel-cat').bind('change', function(){
			var i = $(this).val();
			if (FSN.sel_width == null) {
				FSN.sel_width = $select.width() + 4;
			}
			// опера не понимает <optgroup> при популяции селекта [http://dev.jquery.com/ticket/3040]
			if ($.browser.opera) {
				if (i == 'all') {
					$select.empty().append('<option id="fs--1" value="-1">&nbsp;{L_ALL_AVAILABLE}</option>\n');
					$.each(FSN.fs_og, function(i, v){
					 $select.append( $(document.createElement('optgroup')).attr('label', FSN.fs_lb[i]).append(FSN.fs_og[i]) );
					});
				}
				else {
					$select.empty().append( $(document.createElement('optgroup')).attr('label', FSN.fs_lb[i]).append(FSN.fs_og[i]) );
				}
			}
			else {
				if (i == 'all') {
					var fs_html = FSN.fs_all;
				}
				else {
					var fs_html = '<optgroup label="'+ FSN.fs_lb[i] +'">'+ FSN.fs_og[i] +'</optgroup>';
				}
				$select.html(fs_html).focus();
			}
			if (i == 'all') {
				$('#fs-nav-menu').show();
			}
			else {
				$('#fs-nav-menu').hide();
			}
			$select.width(FSN.sel_width);
		});

		FSN.fs_all = $select.html();

		FSN.nav_inited = true;
	}
};

$(function(){
	FSN.show_nav();
	$('#fs legend').one('mouseenter', FSN.build_nav);
});
</script>

<div class="menu-sub" id="fs-nav-list">
	<div class="tRight"><span id="fs-nav-close" class="med" onclick="$('#fs-nav-list').hide();"> [ {L_HIDE} ] </span></div>
	<ul id="fs-nav-ul" class="tree-root"></ul>
</div>

<div id="fs-nav-legend" style="display: none;">
	<select id="fs-sel-cat"><option value="all">&nbsp;{L_SELECT_CAT}&nbsp;</option></select>
	<span id="fs-nav-menu">&middot;&nbsp;<a class="menu-root" href="#fs-nav-list">{L_GO_TO_SECTION}</a></span>
</div>

<!-- IF TRACKER -->
<form method="POST" name="post" id="tr-post" action="{TOR_SEARCH_ACTION}#results">
<input type="hidden" name="prev_allw" value="1">
<input type="hidden" name="prev_my" value="0">
<input type="hidden" name="prev_dlc" value="0">
<input type="hidden" name="prev_dlw" value="0">
<input type="hidden" name="prev_new" value="0">
<input type="hidden" name="prev_ds" value="0">
<table class="bordered w100 collapse">
<tbody>

<tr class="row2 tCenter">
	<td style="padding: 5px;font-weight: bold;color: rgb(82, 82, 82);">Поиск по раздачам</td>
</tr>
<tr>
	<td class="row4" style="padding: 4px;">
		<table class="fieldsets borderless bCenter pad_0 collapse">
		<tbody>
		<tr>
			<td colspan="2" class="w50">
				<p class="input tCenter">
					<input type="text" size="50" maxlength="60" name="nm" id="nm" style="font-size: 18px;width: 588px !important;border: 1px solid #C0C0C0;padding: 2px 5px;" placeholder="Что ищем?" value="">
					<a href="" onclick="setCookie('tracker', 0);"><b>{L_ADVANCED_SEARCH}</b></a>
				</p>
				<div class="tCenter">
					<input class="bold long" type="submit" style="padding:2px 30px;" name="submit" value="Найти">
				</div>		
			</td>
		</tr>
		</tbody>
		</table>
	</td>
</tr>

</tbody></table>

<table style="background: #f7f7f7;border: 1px solid silver;margin: 10px 0;" class="w100 forumline"><tbody>
<!-- BEGIN tor -->
<tr class="tCenter hl-tr">
	<td style="width: 5%;" class="row1 tCenter">
	<!-- IF tor.IS_NEW --><img src="templates/default/images/icon_tor_new_1.png" alt="{L_NEWS_RELEASE}"><!-- ELSE --><img src="templates/default/images/icon_tor_1.png" alt=""><!-- ENDIF -->	
	</td>
	<td class="row1 tLeft">
		<div class="topic-detail">
			<div>
				<p title="{tor.TOR_STATUS_TEXT}" class="small nowrap" style="padding: 0;"><span class="tor-icon tor-approved">{tor.TOR_STATUS_ICON}</span>&nbsp;<span>Создан:</span>&nbsp;{tor.TOPIC_TIME}&nbsp;&nbsp;<span>Автор:</span>&nbsp;<a class="med" href="{TR_POSTER_URL}{tor.POSTER_ID}">{tor.USERNAME}</a></p>
			</div>
		</div>
		<div>
			<p>
				<a class="gen" href="{TR_FORUM_URL}{tor.FORUM_ID}">{tor.FORUM_NAME}</a>
			</p>
			<br>
			<p>
				<a class="med hl-tags bold" href="{TOPIC_URL}{tor.TOPIC_ID}"><!-- IF tor.TOR_FROZEN -->{tor.TOPIC_TITLE}<!-- ELSE -->{tor.TOR_TYPE}<b>{tor.TOPIC_TITLE}</b><!-- ENDIF --></a>
			</p>
		</div>
	</td>
	<td class="tCenter">
		<br>
		<div>
			<a href="{DOWNLOAD_URL}{tor.ATTACH_ID}" title="Скачать" class="adown">{tor.TOR_SIZE}</a>
		</div>
		<br>
		<div class="torrent-info">
			<b><span class="seedmed" title="Сидов">{tor.SEEDS}</span></b>&nbsp;<span>|</span>&nbsp;<b><span class="leechmed" title="Личеров">{tor.LEECHS}</span></b>&nbsp;<span>|</span>&nbsp;<span title="Ответов: {tor.COMPLETED}" class="med">{tor.COMPLETED}</span>
		</div>
	</td>
</tr>
<!-- END tor -->
<!-- IF TOR_NOT_FOUND -->
<tbody>
	<tr>
		<td class="row1 tCenter pad_8" colspan="{TOR_COLSPAN}">{NO_MATCH_MSG}</td>
	</tr>
</tbody>
<!-- ENDIF / TOR_NOT_FOUND -->
</table>
</form>
<!-- ELSE -->
<form method="POST" name="post" action="{TOR_SEARCH_ACTION}#results">
{S_HIDDEN_FIELDS}

<table class="bordered w100" cellspacing="0">
<col class="row1">
<tr>
	<th class="thHead">{L_TOR_SEARCH_TITLE}</th>
</tr>
<tr>
	<td class="row4" style="padding: 4px";>

		<table class="fieldsets borderless bCenter pad_0" cellspacing="0">
		<tr>
			<td rowspan="2" width="50%">
				<fieldset id="fs">
				<legend>{L_SEARCH_IN_FORUMS}</legend>
				<div>
					<p class="select">{CAT_FORUM_SELECT}</p>
					<p id="fs-qs-div" class="med" style="display: none;"><input id="fs-qs-input" type="text" style="width: 200px;"> {L_FILTER_BY_NAME}</p>
					<p><img width="300" class="spacer" src="{SPACER}" alt="" /></p>
				</div>
				<div>{TOR_NOT_APPROVED} | {TOR_CLOSED} | {TOR_APPROVED} | {TOR_NEED_EDIT} | {TOR_NO_DESC} | {TOR_DUP} | {TOR_CLOSED_CPHOLD} | {TOR_CONSUMED} | {TOR_DOUBTFUL} | {TOR_CHECKING} | {TOR_TMP} | {TOR_UPDATE}</div>
				</fieldset>
			</td>
			<td height="1" width="20%">
				<fieldset>
				<legend>{L_SORT_BY}</legend>
				<div class="med">
					<p class="select">{ORDER_SELECT}</p>
					<p class="radio"><label><input type="radio" name="{SORT_NAME}" value="{SORT_ASC}" {SORT_ASC_CHECKED} /> {L_ASC}</label></p>
					<p class="radio"><label><input type="radio" name="{SORT_NAME}" value="{SORT_DESC}" {SORT_DESC_CHECKED} /> {L_DESC}</label></p>
				</div>
				</fieldset>
				<fieldset>
				<legend>{L_TORRENTS_FROM}</legend>
				<div>
					<p class="select">{TIME_SELECT}</p>
				</div>
				</fieldset>
				<fieldset>
				<legend>{L_SEED_NOT_SEEN}</legend>
				<div>
					<p class="select">{S_NOT_SEEN_SELECT}</p>
				</div>
				</fieldset>
			</td>
			<td width="30%">
				<fieldset>
				<legend>{L_SHOW_ONLY}</legend>
				<div class="gen">
					<p class="chbox">{ONLY_MY_CHBOX}[<b>&reg;</b>]</p>
					<p class="chbox">{ONLY_ACTIVE_CHBOX}</p>
					<p class="chbox">{SEED_EXIST_CHBOX}</p>
					<p class="chbox">{ONLY_NEW_CHBOX}[{MINIPOST_IMG_NEW}]&nbsp;</p>
					<p>
					    <label>
		                    <input type="checkbox" <!-- IF HIDE_CONTENTS -->{CHECKED}<!-- ENDIF -->
							    onclick="user.set('h_tsp', this.checked ? 1 : 0);"
		                    />&nbsp;{L_HIDE_CONTENTS}
	                    </label>
					</p>
					<!-- IF $tr_cfg['gold_silver_enabled'] --><p class="chbox">{TOR_TYPE_CHBOX}</p><!-- ENDIF -->
				</div>
				</fieldset>
				<fieldset>
				<legend>{L_MY_DOWNLOADS}</legend>
				<div>
					<table class="borderless my_downloads" cellspacing="0">
					<tr>
						<td>{DL_COMPL_CHBOX}</td>
						<td>{DL_WILL_CHBOX}</td>
					</tr>
					<tr>
						<td>{DL_DOWN_CHBOX}</td>
						<td>{DL_CANCEL_CHBOX}</td>
					</tr>
					</table>
				</div>
				</fieldset>
			</td>
		</tr>
		<tr>
			<td colspan="2" width="50%">
				<fieldset style="margin-top: 0;">
				<legend>{L_SHOW_COLUMN}</legend>
				<div>
					<p class="chbox">{SHOW_CAT_CHBOX}&nbsp; {SHOW_FORUM_CHBOX}&nbsp; {SHOW_AUTHOR_CHBOX}&nbsp; {SHOW_SPEED_CHBOX}&nbsp;</p>
				</div>
				</fieldset>
				<fieldset>
				<legend>{L_AUTHOR}</legend>
				<div>
					<p class="input"><input style="width: 40%" <!-- IF POSTER_ERROR -->style="color: red"<!-- ELSE --> class="post"<!-- ENDIF --> type="text" size="16" maxlength="{POSTER_NAME_MAX}" name="{POSTER_NAME_NAME}" value="{POSTER_NAME_VAL}" /> <input style="width: 40%;" type="button" value="{L_FIND_USERNAME}" onclick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400'); return false;" /></p>
				</div>
				</fieldset>
				<fieldset>
				<legend>{L_TITLE_MATCH}</legend>
				<div>
					<p class="input">
						<input style="width: 95%;" class="post" type="text" size="50" maxlength="{TITLE_MATCH_MAX}" name="{TITLE_MATCH_NAME}" value="{TITLE_MATCH_VAL}" />
					</p>
					<p class="chbox med">
						{ALL_WORDS_CHBOX}
						&middot; <a class="med" href="#" onclick="return get_fs_link();">{L_SEL_CHAPTERS}</a>
						<!-- IF $bb_cfg['search_help_url'] --> &middot; <a class="med" href="{$bb_cfg['search_help_url']}">{L_SEARCH_HELP_URL}</a><!-- ENDIF -->
					</p>
				</div>
				</fieldset>
			</td>
		</tr>
		</table>

	</td>
</tr>
<tr>
	<td class="row3 pad_4 tCenter">
		<input class="bold long" type="submit" name="submit" value="&nbsp;&nbsp;{L_SEARCH}&nbsp;&nbsp;" />
		<a href="" onclick="setCookie('tracker', 1);"><b>{L_SIMPLE_SEARCH}</b></a>
	</td>
</tr>
</table>

</form>

<div class="spacer_6"></div>

<!-- ENDIF / SHOW_SEARCH_OPT -->
<!-- ENDIF -->
<!-- IF  not TRACKER -->
<table class="w100 border bw_TRL" cellpadding="0" cellspacing="0">
<tr>
	<td class="cat pad_2">

	<table cellspacing="0" cellpadding="0" class="borderless w100">
	<tr>

		<td class="small bold nowrap tRight" width="100%" style="padding: 2px 8px 5px 4px;">
			&nbsp;
			<!-- IF LOGGED_IN -->
			<a class="menu-root" href="#tr-options">{L_DISPLAYING_OPTIONS}</a>
			<!-- ENDIF / LOGGED_IN -->
		</td>

	</tr>
	</table>

	</td>
</tr>
</table>

<!-- IF LOGGED_IN -->
<div class="menu-sub" id="tr-options">
	<table cellspacing="1" cellpadding="4">
	<tr>
		<th>{L_DISPLAYING_OPTIONS}</th>
	</tr>
	<tr>
		<td>
			<fieldset id="ajax-topics">
			<legend>{L_OPEN_TOPICS}</legend>
			<div class="med pad_4">
				<label>
					<input type="checkbox" <!-- IF AJAX_TOPICS -->{CHECKED}<!-- ENDIF -->
						onclick="user.set('tr_t_ax', this.checked ? 1 : 0);"
					/>{L_OPEN_IN_SAME_WINDOW}
				</label>
				<label>
					<input type="checkbox" <!-- IF SHOW_TIME_TOPICS -->{CHECKED}<!-- ENDIF -->
						onclick="user.set('tr_t_t', this.checked ? 1 : 0);"
					/>{L_SHOW_TIME_TOPICS}
				</label>
				<label>
					<input type="checkbox" <!-- IF SHOW_CURSOR -->{CHECKED}<!-- ENDIF -->
						onclick="user.set('hl_tr', this.checked ? 1 : 0);"
					/>{L_SHOW_CURSOR}
				</label>
				<label>
					<input type="checkbox" <!-- IF B_TOPIC -->{CHECKED}<!-- ENDIF -->
						onclick="user.set('hl_brak', this.checked ? 1 : 0);"					
					/>{SHOW_TOPICS_ALLOCATE}
				</label>
			</div>
			</fieldset>
		</td>
	</tr>
	<tr>
		<td class="cat tCenter pad_4"><input type="button" value="{L_SUBMIT}" style="width: 100px;" onclick="window.location.reload();" /></td>
	</tr>
	</table>
</div><!--/tr-options-->
<!-- ENDIF / LOGGED_IN -->

<a name="results"></a>
<table class="forumline tablesorter" id="tor-tbl">
<thead>
<tr>
	<th class="{sorter: false}">&nbsp;</th>
	<th class="{sorter: 'text'}">&nbsp;</th>
	<!-- IF SHOW_CAT -->
	<th class="{sorter: 'text'}" title="{L_CATEGORY}"><b class="tbs-text">{L_CATEGORY}</b></th>
	<!-- ENDIF -->
	<!-- IF SHOW_FORUM -->
	<th class="{sorter: 'text'}" width="25%" title="{L_FORUM}"><b class="tbs-text">{L_FORUM}</b></th>
	<!-- ENDIF -->
	<th class="{sorter: 'text'}" width="75%" title="{L_TOPIC}"><b class="tbs-text">{L_TOPIC}</b></th>
	<!-- IF SHOW_AUTHOR -->
	<th class="{sorter: 'text'}" title="{L_AUTHOR}"><b class="tbs-text">{L_AUTHOR}</b ></th>
	<!-- ENDIF -->
	<th class="{sorter: 'digit'}" title="{L_SIZE}"><b class="tbs-text">{L_SIZE}</b></th>
	<th class="{sorter: 'digit'}" title="{L_SEEDERS}"><b class="tbs-text">S</b></th>
	<th class="{sorter: 'digit'}" title="{L_LEECHERS}"><b class="tbs-text">L</b></th>
	<th class="{sorter: 'digit'}" title="{L_COMPLETED} / {L_REPLIES}"><b class="tbs-text">C</b></th>
	<!-- IF SHOW_SPEED -->
	<th class="{sorter: false }" title="{L_DL_SPEED}"><b class="tbs-text">SP</b></th>
	<!-- ENDIF -->
	<th class="{sorter: 'digit'}" title="{L_ADDED}"><b class="tbs-text">{L_ADDED}</b></th>
</tr>
</thead>

<!-- BEGIN tor -->
<tr class="tCenter <!-- IF SHOW_CURSOR -->hl-tr<!-- ENDIF -->" id="tor_{tor.POST_ID}">
	<td class="row1"><!-- IF tor.USER_AUTHOR --><p style="padding-bottom: 3px">&nbsp;<b>&reg;</b>&nbsp;</p><!-- ELSEIF tor.IS_NEW -->{MINIPOST_IMG_NEW}<!-- ELSE -->{MINIPOST_IMG}<!-- ENDIF --></td>
	<td class="row1 tCenter" title="{tor.TOR_STATUS_TEXT}">{tor.TOR_STATUS_ICON}</td>
	<!-- IF SHOW_CAT -->
	<td class="row1"><a class="gen" href="{TR_CAT_URL}{tor.CAT_ID}">{tor.CAT_TITLE}</a></td>
	<!-- ENDIF -->
	<!-- IF SHOW_FORUM -->
	<td class="row1"><a class="gen" href="{TR_FORUM_URL}{tor.FORUM_ID}">{tor.FORUM_NAME}</a></td>
	<!-- ENDIF -->
	<td class="row4 med tLeft">
		<a class="{tor.DL_CLASS}<!-- IF AJAX_TOPICS --> folded2<!-- ENDIF --> tLink <!-- IF B_TOPIC -->hl-tags bold<!-- ELSE -->bold<!-- ENDIF -->" <!-- IF AJAX_TOPICS -->onclick="ajax.view_post({tor.POST_ID}, this); return false;"<!-- ENDIF --> href="{TOPIC_URL}{tor.TOPIC_ID}"><!-- IF tor.TOR_FROZEN -->{tor.TOPIC_TITLE}<!-- ELSE -->{tor.TOR_TYPE}<b>{tor.TOPIC_TITLE}</b><!-- ENDIF --></a>
	    <!-- IF SHOW_TIME_TOPICS --><div class="tr_tm">{tor.TOPIC_TIME}</div><!-- ENDIF -->
	</td>
	<!-- IF SHOW_AUTHOR -->
	<td class="row1"><a class="med" href="{TR_POSTER_URL}{tor.POSTER_ID}">{tor.USERNAME}</a></td>
	<!-- ENDIF -->
	<td class="row4 small nowrap">
		<u>{tor.TOR_SIZE_RAW}</u>
		<!-- IF not tor.TOR_FROZEN --><a class="small tr-dl" title="{L_DOWNLOAD}" href="{DOWNLOAD_URL}{tor.ATTACH_ID}">{tor.TOR_SIZE}</a> <!-- IF MAGNET_LINKS --><span title="{L_MAGNET}">{tor.MAGNET}</span><!-- ENDIF --><!-- ELSE -->
		{tor.TOR_SIZE}<!-- ENDIF -->
	</td>
	<td class="row4 seedmed" title="{tor.SEEDS_TITLE}"><b>{tor.SEEDS}</b></td>
	<td class="row4 leechmed" title="{L_LEECHERS}"><b>{tor.LEECHS}</b></td>
	<td class="row4 small" title="{L_REPLIES}: {tor.REPLIES}">{tor.COMPLETED}</td>
	<!-- IF SHOW_SPEED -->
	<td class="row4 nowrap">
		<p class="seedmed">{tor.UL_SPEED}</p>
		<p class="leechmed">{tor.DL_SPEED}</p>
	</td>
	<!-- ENDIF -->
	<td class="row4 small nowrap" style="padding: 1px 3px 2px;" title="{L_ADDED}">
		<u>{tor.ADDED_RAW}</u>
		<p>{tor.ADDED_TIME}</p>
		<p>{tor.ADDED_DATE}</p>
	</td>
</tr>
<!-- END tor -->

<!-- IF TOR_NOT_FOUND -->
<tbody>
<tr>
	<td class="row1 tCenter pad_8" colspan="{TOR_COLSPAN}">{NO_MATCH_MSG}</td>
</tr>
</tbody>
<!-- ENDIF / TOR_NOT_FOUND -->
<tfoot>
<tr>
	<td class="catBottom" colspan="{TOR_COLSPAN}">&nbsp;</td>
</tr>
</tfoot>
</table>
<!-- ENDIF / TRACKER -->

<div class="bottom_info">

	<div class="nav">
		<p style="float: left">{PAGE_NUMBER}</p>
		<p style="float: right">{PAGINATION}</p>
		<div class="clear"></div>
	</div>

	<div class="spacer_4"></div>

	<div id="timezone">
		<p>{LAST_VISIT_DATE}</p>
		<p>{CURRENT_TIME}</p>
		<p>{S_TIMEZONE}</p>
	</div>
	<div class="clear"></div>

</div><!--/bottom_info-->

<script type="text/javascript">
$('#no-js-warn').hide();

$.each( [{SELECTED_FORUMS}], function(i,n){ $('#fs-'+ n).prop({selected: true}) });
$('#search_opt').show();

// Растягивание страницы длинными названиями
ajax.resize_wbr_els = function ()
{
	var w = $(window).width() - 20;
	$('.f-name').css({  'min-width': Math.round( w * 0.14 ) +'px' });
	$('.t-title').css({ 'max-width': Math.round( w * 0.52 ) +'px' });
	$('.u-name').css({      'width': Math.round( w * 0.08 ) +'px' });
}
// Выделение тегов и текста в скобках
ajax.divide_title_tags = function ()
{
	var rgx_test_lead_tags  = /^\s*(\(|\[|\{)/;                    // скобка в начале
	var rgx_1st_lead_tags   = /^\s*(\(.+?\)|\[.+?\]|\{.+?\})\s*/;  // m[1] = '(tag1, tag2)'
	var rgx_crop_tags       = /[\(\)\[\]\{\}]/g;                   // (tag1, tag2) -> tag1, tag2
	var rgx_split_tags      = /\s*[~,\|\/\\]\s*/;                  //  tag1, tag2  -> [tag1, tag2]
	var rgx_cleanup_delims  = /([~,\|\/\\])([~,\|\/\\])+/g;        //  ,/~~~       -> ,
	var rgx_test_empty_tag  = /[0-9a-zA-Zа-яА-ЯёЁ]/;
	var rgx_clean_tag_chars = /"<>/g;
	var rgx_cut_leftovers   = /^\[^0-9a-zA-Zа-яА-ЯёЁ&\(\[\{]+/;           // возможные остатки разделителей в начале названия

	$('a.hl-tags').each(function(){
		var t_id   = $(this).data('topic_id');
		var t_html = this.innerHTML;
		var t_tags = [];
		var tags_group, tags_apart;

		if (rgx_test_lead_tags.test(t_html)) {
			t_html = t_html.replace(rgx_cleanup_delims, '$1');
			while( m = t_html.match(rgx_1st_lead_tags) ) {
				t_html = t_html.replace(m[0], '');
				t_html = t_html.replace(rgx_cut_leftovers, '');
				tags_group = m[1].replace(rgx_crop_tags, '');
				tags_group = tags_group.replace(rgx_clean_tag_chars, ' ');
				tags_apart = ajax.fix_tag_exceptions( $.trim(tags_group) );
				tags_apart = tags_apart.split(rgx_split_tags);
				tags_apart = $.grep(tags_apart, function(tag,i){
					return rgx_test_empty_tag.test(tag);
				});
				if (tags_apart.length) {
					t_tags = t_tags.concat(tags_apart);
				}
			}
			if (t_tags.length) {
				$('#tg-'+ t_id).append('<span class="tg">'+ t_tags.sort().join('</span><span class="tg">') +'</span>');
			}
		}
		this.innerHTML = t_html.replace(rgx_cut_leftovers, '');
	});
	$('span.tg').click(function(){
		var search_txt = $(this).text().replace(/[^0-9a-zA-Zа-яА-ЯёЁ\-]/g, ' ').replace(/\s+/g, ' ');
		$('#title-search').val(search_txt);
		$('#tr-form').submit();
	});
}
ajax.fix_tag_exceptions = function (txt)
{
	txt = txt.replace(/^\s*([\d.]+)\s*([\/\\])\s*([\d.]+)\s*$/, '$1&#47;$3');    // [24/192] [16/44.1]
	return $.trim(txt);
}
ajax.hl_text_in_brackets = function ()
{
	$('a.hl-tags').each(function(){
		this.innerHTML = this.innerHTML.replace( /(\(.+?\)|\[.+?\]|\{.+?\})/g, '<span class="brackets-pair">$1</span>' );
	});
}

$(function(){
	ajax.divide_title_tags();	ajax.hl_text_in_brackets();	$('a.tLink').each(function(){
		if (user.opt_js.h_tsp) {
			this.innerHTML = this.innerHTML.replace(/\{.+?\}/g, '{...}');  // Скрыть содержимое {...}
		}
		this.innerHTML = this.innerHTML.replace(/([\.,](?!\s))/g, '$1');
	});

	ajax.resize_wbr_els();
	$('#search-results').show();
	$('#tor-tbl').tablesorter(); //	{debug: true}

	// лимит на количество выбранных разделов
	ajax.fs_last_val = $('#fs-main').val();

	$('#fs-main').bind('change', function(){
		var fs_val = $('#fs-main').val();
		// снятие отметки со "Все имеющиеся"
		if (fs_val.length > 1 && $.inArray('-1', fs_val) != -1) {
			$('#fs--1').prop({selected: false});
			fs_val = $('#fs-main').val();
		}
		// лимит на количество выбранных разделов
		if (fs_val != null) {
			if (fs_val.length > 50) {
				alert('{L_SEL_CHAPTERS_HELP}');
				$('#fs-main').val( ajax.fs_last_val );
			}
			else {
				ajax.fs_last_val = fs_val;
			}
		}
	});
	if ($.browser.mozilla) {
		$('#fs-qs-input').focus().quicksearch('#fs-main option', {
			delay   : 300,
			onAfter : function(){
				$('#fs-main optgroup').show();
				$('#fs-main option:hidden').parent('optgroup').not( $('#fs-main :visible').parent('optgroup') ).hide();
			}
		});
		$('#fs-main').attr( 'size', $('#fs-main').attr('size')-1 );
		$('#fs-qs-div').show();
	}
		$('#tr-form').submit(function(){
		var selected_forums = $('#fs-main').val();
		var search_query    = $.trim( $('#title-search').val() );
		var url_params      = [];

		if (selected_forums != null && $.inArray('-1', selected_forums) == -1) {
			url_params.push( 'f='+ selected_forums.sort().join() );
		}
		if (search_query != '') {
				url_params.push( 'nm='+ encodeURIComponent(search_query) );
		}
		if (url_params.length) {
			$('#tr-form').attr({ action: 'tracker.php?'+ url_params.join('&') });
		}
	});
});
function get_fs_link ()
{
	var fs_val = $('#fs-main').val();

	if (fs_val != null && $.inArray('-1', fs_val) == -1) {
		window.prompt( '{L_SEL_CHAPTERS}:', './tracker.php?f='+ fs_val.sort().join() );
	}
	else {
		alert('{L_NOT_SEL_CHAPTERS}');
	}
	return false;
}
</script>